#pragma once
#include <codec.h>

class audio_encoder : public ICodec
{
private:
    /* data */
public:
    audio_encoder(const char* codec_name,AVCodecParameters* codecpar);
    ~audio_encoder();
    int  decode(AVPacket* pkt,AVFrame* frame,int eof,int& got,int* finished) override;
    int  encode(const AVFrame*  frame, AVPacket* packet,int& got,int* finished) override;
    AVMediaType get_codec_type() const override;

private: 
    AVCodec *m_enc = nullptr;
    AVCodecContext  *m_enc_ctx = nullptr;
    std::string m_codec_name;
    bool m_open_success = false;
};

